package org.gdtc.storefront.service;


import org.gdtc.storefront.entity.Classification;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@RequestMapping("/ClassificationService")
public interface ClassificationService {
    @RequestMapping("/deleteByPrimaryKey")
    int deleteByPrimaryKey(@RequestParam("id") Integer id);

    @RequestMapping("/insert")
    int insert(Classification record);

    @RequestMapping("/selectByPrimaryKey")
    Classification selectByPrimaryKey(@RequestParam("id") Integer id);

    @RequestMapping("/selectIdByClassthreename")
    int selectIdByClassthreename(@RequestParam("classthreename") String classthreename);
    @RequestMapping("/selectAll")
    List<Classification> selectAll();

    @RequestMapping("/selectThree")
    List<Classification> selectThree(@RequestParam("storeid") Integer storeid, @RequestParam("classone") Integer classone, @RequestParam("classthree") Integer classthree);

    @RequestMapping("/updateByPrimaryKey")
    int updateByPrimaryKey(Classification record);


    //查询一级分类
    @RequestMapping("/QueryClassone")
    List<Classification> QueryClassone(@RequestParam("storeid") Integer storeid);


    //查询二级分类
    @RequestMapping("/QueryClasstwo")
    List<Classification> QueryClasstwo(@RequestParam("storeid") Integer storeid,
                                       @RequestParam("classone") Integer classone);

    //查询三级分类
    @RequestMapping("/QueryClassthree")
    List<Classification> QueryClassthree(@RequestParam("storeid") Integer storeid,
                                         @RequestParam("classtwo") Integer classtwo);

    //查询最后一条记录的一级分类ID
    @RequestMapping("/QueryClassoneLimit")
    int QueryClassoneLimit();

    //查询最后一条记录的二级分类ID
    @RequestMapping("/QueryClasstwoLimit")
    int QueryClasstwoLimit();

    //查询最后一条记录的三级分类ID
    @RequestMapping("/QueryClassthreeLimit")
    int QueryClassthreeLimit();

    //添加一级分类
    @RequestMapping("/InsClassone")
    int InsClassone(@RequestParam("storeid") Integer storeid,
                    @RequestParam("classone") Integer classone,
                    @RequestParam("classonename") String classonename);

    //添加二级分类
    @RequestMapping("/InsClasstwo")
    int InsClasstwo(@RequestParam("storeid") Integer storeid,
                    @RequestParam("classone") Integer classone,
                    @RequestParam("classtwo") Integer classtwo,
                    @RequestParam("classtwoname") String classtwoname);

    //添加三级分类
    @RequestMapping("/InsClassthree")
    int InsClassthree(@RequestParam("storeid") Integer storeid,
                      @RequestParam("classone") Integer classone,
                      @RequestParam("classtwo") Integer classtwo,
                      @RequestParam("classthree") Integer classthree,
                      @RequestParam("classthreename") String classthreename);

    //删除一级分类
    @RequestMapping("/DelClassone")
    int DelClassone(@RequestParam("classone") Integer classone, @RequestParam("storeid") Integer storeid);

    //删除二级分类
    @RequestMapping("/DleClasstwo")
    int DelClasstwo(@RequestParam("classtwo") Integer classtwo, @RequestParam("storeid") Integer storeid);

    //删除三级分类
    @RequestMapping("/DelClassthree")
    int DelClassthree(@RequestParam("classthree") Integer classthree, @RequestParam("storeid") Integer storeid);

    //默认加载所有一级分类
    @RequestMapping("/QueryClass")
    List<Classification> QueryClass();

    //默认加载所有二级分类
    @RequestMapping("/QueryClasstwos")
    List<Classification> QueryClasstwos();

    //默认加载所有三级分类
    @RequestMapping("/QueryClassthrees")
    List<Classification> QueryClassthrees();
}
